1. Field of the Invention
The present invention relates to an image processing device, and more specifically to a cylindrical container inner surface tester for checking the inner surface of a cylindrical container having a joint in the side of a beer can with metal luster, a paper cup, etc. to be carried on a conveyor, and for detecting foreign substances, dust, scratches, etc. on the surface.
2. Description of the Prior Art
FIGS. 1A and 1B are views for explaining a highlighted portion of a sample aluminum beer can when observed from above. FIG. 1A is a top view (image) of the container (can) and FIG. 1B is its sectional view. 2 is a container; 1 is a ring illumination for illuminating the container 2 from above; 3 is a highlighted portion at the opening of the container; and 4 is a valley highlighted portion. Thus, the portions 3 and 4 are highlighted at the opening and the bottom of the container. They are specifically highlighted if the container has metallic raster inside.
FIGS. 2A and 2B show intensity variations represented by the scanning line Q - Q1 on the top view of the container 2. The intensity variations can be classified into 5 level area from W1 to W5. First area W1 refers to the highlighted opening portion 3; second area W2 refers to the internal upper middle part of the container indicating comparatively high intensity; third area W3 refers to the internal lower middle part of the container subject to less amount of light of the illumination 1 shown in FIG. 1A indicating intensity lower than other portion of the container; fourth area W4 refers to the highlighted portion of the bottom; and fifth area W5 refers to the inner bottom of the container.
Conventionally, these areas W1-W5 are provided with a window individually and assigned thresholds used for detecting defects such as blacks spots (black points) and white spots (white points) according to the optical characteristics of each area. One method of detecting a defect is, for example, to convert by a predetermined threshold a multi-value continuous tone image signal of 8 bits, etc. to a binary value. The signal is obtained by A/D-converting an analog video signal (analog continuous tone image signal) obtained by scanning a target image. Another method is a differentiation method in which the above-described video signal is differentiated through a differentiation circuit as shown in FIG. 3 to extract a defect signal. In the differentiation method, a differentiation signal can be obtained for the contour of a test object. While either of a positive pulse or a negative pulse is generated by the differentiation along the contour of a test object, these pulses are generated simultaneously at a fine defective point, thereby extracting a defect.
That is, if the following expressions exist between the a value P(i,j) and values P(i-.alpha., j) and P(i+.beta., j), where P(i,j) indicates a target point (coordinates x=i and y=j) referred to by a signal P(x,y) obtained by differentiating an analog continuous tone image signal generated by a raster scanning operation, and P(i-.alpha., j) and P(i+.beta., j) indicate the points .alpha. picture elements forward and .beta. picture elements backward of the above-described point P(i,j) in the x direction of the scanning line. EQU P(i,j)-P(i-.alpha., j)&gt;TH1 and EQU P(i+.beta., j)-P(i,j)&gt;TH1
where TH1 indicates a predetermined threshold (positive value).
A binary function values PD(i,j)=1 and PD(i,j)=0 are defined for detecting a defect on a target point and respectively indicate an abnormal black point and a normal point.
However, in the above-described defect detecting method, an optimum value of a threshold TH1 to be determined by optical characteristics of a container's inner surface is subject to change. Accordingly, in the conventional method, a number of concentric circle windows are necessary as shown by windows W1-W5 in FIG. 2B (five windows in this case). Simultaneously, these windows must be assigned different thresholds TH1 (and coordinates .alpha., .beta.). Thus, much time is wasted during the raster scanning operation, thereby offering a bottleneck to a high speed defect detection.
FIGS. 4A to 4C are views for explaining the problem in the conventional defect detecting method based on the differentiation method. FIG. 4A shows an example of intensity variations (analog continuous tone image signal) represented by the scanning line Q-Q1; FIG. 4B shows an example of an analog differentiation signal shown in FIG. 4A; and FIG. 4C shows an example of a digital differentiation signal shown in FIG. 4A. The portions indicated by BDs shown in FIGS. 4A-4C refer to black spots. That is, there are following problems in the conventional defect detecting method in which a black level defect BD is extracted by a signal in the area having intensity variations as shown in FIG. 4A. In the analog differentiation method, a differentiation signal indicating a small defective point is superposed on a basic intensity differentiation signal according to a time constant of a filter circuit as shown in FIG. 4B. In the digital differentiation method, a signal indicates unstable values as shown in FIG. 4C, and a differentiation signal indicating a defective point is embedded in noise components, thereby getting in difficulties in detecting a defect signal according to a predetermined threshold.
FIG. 5A is a sample top view of a container 2 having a projecting portion 2a which often generates highlighted portions 4-1, 4-2, etc. in series according to the form of the container's bottom or the variations in the reflection of a light off the side of the container. Specifically, most metallic containers have a mirror like inner surface and cause the above described problems.
Such highlighted portions can be hardly removed only by appropriately using an illumination. Therefore, the conventional defect detecting method has, in vain, to solve the above described uneven illumination generated as a highlighted portion inside a test container in testing its inner surface.
The first object of the present invention is to provide a cylindrical container's inner surface tester for detecting a defective portion stably and precisely even though there is uneven illumination inside a test container.
FIG. 6A shows a paper cup 5, that is, a typical cylindrical container, and the sectional view of a ring illumination 1 provided above the paper cup 5. FIG. 6B shows an example of an image (image data stored in a frame memory of the tester) obtained by capturing the inner surface of the paper cup 5 from above the paper cup 5 by a wide-angle-lens camera not shown in FIG. 6A. As shown in FIG. 6B, a joint 6 is detected in the side of the cup in the image. The joint 6 can be considered to be a generally straight line. However, since the opening of the paper cup 5 is formed as a curled rim for reinforcement, a top-end joint 7 is not in the line of the joint 6, indicating irregularity. Furthermore, since a normal cylindrical container can rotate at any angle while it is carried on a conveyor, the position of the joint 6 in the side of the container cannot be specified in a test image.
Assume that a spot 8 exists around the top-end joint 7 indicating the irregularity at the end of the straight line. Conventionally, the joint 6 is considered to be a straight line, and a multi-value continuous tone image signal (image data) read from a frame memory is converted to a binary value according to a predetermined threshold to generate a binary image signal. Then, the coordinate of each point of picture elements forming the joint can be determined by scanning the binary image signal and storing the coordinate indicating a change in binary image signals. Next, it is determined whether or not each point is in the joint. If a coordinate is obtained as being in the straight line, then it indicates that the point is in the joint. Then, an image indicating a spot is detected around the joint. For example, a regression line is obtained from the coordinate of each change point; the distance from the regression line to each of the above described coordinates is obtained; and all distance values are added up. An image indicating a spot around the joint 6 can be determined by checking the sum whether or not it is equal to or smaller than a predetermined threshold.
However, the top-end joint 7 detected at the curled rim indicates irregular data compared with the joint 6, and is not in the joint 6 according to the above described conventional method of detecting a picture element indicating a spot. Therefore, if the top-end joint 7 is included in the determination, the difference between the top-end joint 7 and an approximated line of the joint 6 is accumulated as an error when the above described sum is obtained, thereby lowering the precision of a test around the joint 6. Accordingly, the deterioration in precision cannot be prevented if the joint 6 and the top-end joint 7 are tested as being processed in the same test area. Thus, it is necessary to process each of the joint 3 and the top-end joint 7 in a separate test area. Since the cylindrical container (paper cup 5) freely rotates as described above, the position of the joint 6 is calculated according to a binary image signal generated for each test image. According to the result, the position of the top-end joint 7 can be determined.
A method of processing the top-end joint 7 in a separate area can be to detect a picture element indicating a spot by specifying the area between a broken line 9 and the circumference of the container as an independent test area according to an outline detecting method and performing a binary conversion using an appropriate threshold. However, according to this method, a test area specified as the area around the top-end joint 7 is exceedingly large, thereby taking a long time in performing an arithmetic operation to test a single paper cup 5. As a result, the test cannot be practically carried out at a container production speed.
As described above, an efficient method of testing the area around the top-end joint 7 by limiting it to a small area has been required, but has not been developed yet. The second object of the present invention is to provide a cylindrical container inner surface tester for practically testing a picture element indicating a spot around the top-end joint 7 at a high speed enough to perform a test at a production speed and with high precision.